import { Component, ViewChild} from '@angular/core';
import { IonicPage, NavController, NavParams, ModalController } from 'ionic-angular';
import { Slides } from 'ionic-angular';

// import { ModalControllerPage } from "../modal-controller/modal-controller";
// import { Testpage1Page } from '../testpage1/testpage1';
// import { Testpage2Page } from "../testpage2/testpage2";
/**
 * Generated class for the IonicUiPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-ionic-ui',
  templateUrl: 'ionic-ui.html',
})
export class IonicUiPage {
  tab: string = "tab1"
  msg: any = "这是ionicUi 页面的msg"
  testpage2 ;
  testpage4 ;
  constructor(public navCtrl: NavController, 
    public navParams: NavParams,
    public modalCtrl: ModalController
  ) {
    this.testpage2 = "Testpage2Page";  // 使用懒加载时app.module.ts不用引入页面;这里改为加双引号: "SecondPage"
    this.testpage4 = "Testpage4Page";  
  }

  @ViewChild(Slides) slides: Slides;

  ionViewDidLoad() {
    console.log('ionViewDidLoad IonicUiPage');
  }

  ionViewDidEnter() {
    this.slides.autoplayDisableOnInteraction = false;
  }

  gotoTestpage1Page() {
    this.navCtrl.push("Testpage1Page")

  }
  gotoTestpage3Page() {
    this.navCtrl.push("Testpage3Page",{
      ionicmsg:this.msg
    })
  }
  gotomodalcontroller(){
    let ModalControllerPage = this.modalCtrl.create("ModalControllerPage");
    ModalControllerPage.present();  
  }
  
  // 到投票页面
  gotoToupiao(){
    this.navCtrl.push("ToupiaoPage")
  }
}
